if ($.fn.pagination) {
	$.fn.pagination.defaults.beforePageText = 'Page';
	$.fn.pagination.defaults.afterPageText = 'of {pages}';
	$.fn.pagination.defaults.displayMsg = 'Displaying {from} to {to} of {total} items';
}
if ($.fn.datagrid) {
	$.fn.datagrid.defaults.loadMsg = 'Processing, please wait ...';
}

if ($.fn.treegrid && $.fn.datagrid) {
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager) {
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Cancel';
	$.messager.defaults.error = 'Error';
	$.messager.defaults.success = 'Success';
	$.messager.info.title = 'Info';
	$.messager.warning.title = 'Warning';
	$.messager.error.title = 'Error';
	$.messager.question.title = 'Question';
	$.messager.confirm.title = 'Confirm';
	$.messager.show.title = 'Message';
	$.messager.defaults.submitMsg = 'Submitting, please wait ...';
	$.messager.defaults.exportMsg = 'Exporting, please wait ...';
	$.messager.defaults.exportError = 'Export file error ...';
	$.messager.defaults.loadDataError = 'Loading data exception,Pls contact your system administrator.';
}
$.map([ 'validatebox', 'textbox', 'passwordbox', 'filebox', 'searchbox',
		'combo', 'combobox', 'combogrid', 'combotree', 'datebox',
		'datetimebox', 'numberbox', 'spinner', 'numberspinner', 'timespinner',
		'datetimespinner' ], function(plugin) {
	if ($.fn[plugin]) {
		$.fn[plugin].defaults.missingMessage = 'This field is required.';
	}
});
if ($.fn.validatebox) {
	$.fn.validatebox.defaults.rules.email.message = 'Please enter a valid email address.';
	$.fn.validatebox.defaults.rules.url.message = 'Please enter a valid URL.';
	$.fn.validatebox.defaults.rules.length.message = 'Please enter a value length between {0} and {1}.';
	$.fn.validatebox.defaults.rules.remote.message = 'Please fix this field.';
	$.fn.validatebox.defaults.rules.username.message = '4 to 30 characters, contains letters, numbers and underline symbol.';
	$.fn.validatebox.defaults.rules.password.message = '9 to 22 characters, contains letters, numbers and symbol.';
	$.fn.validatebox.defaults.rules.filename.message = 'Please enter a valid file name.';
	$.fn.validatebox.defaults.rules.internetAddress.message = 'Please enter a valid email address.';
	$.fn.validatebox.defaults.rules.lessThan.message = 'Please enter a less than {0}.';
	$.fn.validatebox.defaults.rules.lessThanEqual.message = 'Please enter a less than or equal {0}.';
	$.fn.validatebox.defaults.rules.greaterThan.message = 'Please enter a greater than {0}.';
	$.fn.validatebox.defaults.rules.greaterThanEqual.message = 'Please enter a greater than or equal {0}.';
	$.fn.validatebox.defaults.rules.equals.message = 'Field do not match.';
	$.fn.validatebox.defaults.rules.between.message = 'Please enter a value between {0} and {1}.';
	$.fn.validatebox.defaults.rules.minLength.message = 'Please enter a value length at least {0}.';
	$.fn.validatebox.defaults.rules.maxLength.message = 'Please enter a value length less than {0}.';
	$.fn.validatebox.defaults.rules.afterDate.message = 'Please enter a greater than {0}.';
	$.fn.validatebox.defaults.rules.beforeDate.message = 'Please enter a less than {0}.';
}
if ($.fn.calendar) {
	$.fn.calendar.defaults.weeks = [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ];
	$.fn.calendar.defaults.months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ];
}
if ($.fn.datebox) {
	$.fn.datebox.defaults.currentText = 'Today';
	$.fn.datebox.defaults.closeText = 'Close';
	$.fn.datebox.defaults.okText = 'Ok';
	$.fn.datebox.defaults.cleanText = 'Clean';
	$.fn.datebox.defaults.formatter = function(date) {
		var y = date.getFullYear();
		var m = date.getMonth() + 1;
		var d = date.getDate();
		return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
	};
	$.fn.datebox.defaults.parser = function(s) {
		if (!s) return new Date();
		var ss = s.split('-');
		var y = parseInt(ss[0], 10);
		var m = parseInt(ss[1], 10);
		var d = parseInt(ss[2], 10);
		if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {
			if (y < 1900) return new Date(1900, 0, 1);
			if (y > 9999) return new Date(9999, 11, 31);
			return new Date(y, m - 1, d);
		} else {
			return new Date();
		}
	};
	var buttons = $.extend([], $.fn.datebox.defaults.buttons);
	buttons.splice(1, 0, {
		text : function(target) {
			return $(target).datebox("options").cleanText
		},
		handler : function(target) {
			$(target).datebox("setValue", "");
			$(target).datebox("hidePanel");
		}
	});
	$.extend($.fn.datebox.defaults, {
		buttons : buttons
	});
}
if ($.fn.datetimebox && $.fn.datebox) {
	var buttons = $.extend([], $.fn.datetimebox.defaults.buttons);
	buttons.splice(2, 0, {
		text : function(target) {
			return $(target).datetimebox("options").cleanText
		},
		handler : function(target) {
			$(target).datetimebox("setValue", "");
			$(target).datetimebox("hidePanel");
		}
	});
	$.extend($.fn.datetimebox.defaults, {
		currentText : $.fn.datebox.defaults.currentText,
		closeText : $.fn.datebox.defaults.closeText,
		okText : $.fn.datebox.defaults.okText,
		cleanText : $.fn.datebox.defaults.cleanText,
		buttons : buttons
	});
}
if ($.fn.datetimespinner) {
	$.fn.datetimespinner.defaults.selections = [ [ 0, 4 ], [ 5, 7 ], [ 8, 10 ], [ 11, 13 ], [ 14, 16 ], [ 17, 19 ] ]
}
if ($.fn.combogrid) {
	$.fn.combogrid.defaults.columnNo = 'No';
	$.fn.combogrid.defaults.columnName = 'Name';
}